package org.xserver.component.extension.filter.spring;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.w3c.dom.Element;
import org.xserver.component.extension.filter.FilterConfig;

/**
 * <pre>
 * 
 * <xml>sd </xml>
 * </pre>
 * 
 * @author idoldefine
 * @since 2015/10/22
 * 
 */
public class FilterBeanDefinitionParse extends
		AbstractSingleBeanDefinitionParser {
	@Override
	protected Class<FilterConfig> getBeanClass(Element element) {
		return FilterConfig.class;
	}

	@Override
	protected void doParse(Element element, BeanDefinitionBuilder builder) {
		String filterName = element.getAttribute("name");
		builder.addConstructorArgValue(filterName);

		String filterClass = element.getAttribute("class");
		builder.addConstructorArgValue(filterClass);
	}
}
